{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Program Files (x86)\\Anaconda3\\lib\\site-packages\\pandas\\core\\internals.py:3224: FutureWarning: Passing in 'datetime64' dtype with no frequency is deprecated and will raise in a future version. Please pass in 'datetime64[ns]' instead.\n",
      "  return self.apply('astype', dtype=dtype, **kwargs)\n"
     ]
    }
   ],
   "source": [
    "# 获取shibor数据\n",
    "import tushare as ts\n",
    "df = ts.shibor_data() #取当前年份的数据\n",
    "#df = ts.shibor_data(2014) #取2014年的数据\n",
    "# df.sort('date', ascending=False).head(10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>date</th>\n",
       "      <th>ON</th>\n",
       "      <th>1W</th>\n",
       "      <th>2W</th>\n",
       "      <th>1M</th>\n",
       "      <th>3M</th>\n",
       "      <th>6M</th>\n",
       "      <th>9M</th>\n",
       "      <th>1Y</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2018-01-02</td>\n",
       "      <td>2.6570</td>\n",
       "      <td>2.8390</td>\n",
       "      <td>3.9430</td>\n",
       "      <td>4.7430</td>\n",
       "      <td>4.8040</td>\n",
       "      <td>4.8310</td>\n",
       "      <td>4.7150</td>\n",
       "      <td>4.7470</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2018-01-03</td>\n",
       "      <td>2.5635</td>\n",
       "      <td>2.7850</td>\n",
       "      <td>3.8700</td>\n",
       "      <td>4.6220</td>\n",
       "      <td>4.7300</td>\n",
       "      <td>4.7830</td>\n",
       "      <td>4.7110</td>\n",
       "      <td>4.7360</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2018-01-04</td>\n",
       "      <td>2.5050</td>\n",
       "      <td>2.7600</td>\n",
       "      <td>3.8020</td>\n",
       "      <td>4.4760</td>\n",
       "      <td>4.6870</td>\n",
       "      <td>4.7380</td>\n",
       "      <td>4.7020</td>\n",
       "      <td>4.7286</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2018-01-05</td>\n",
       "      <td>2.4840</td>\n",
       "      <td>2.7450</td>\n",
       "      <td>3.7490</td>\n",
       "      <td>4.3756</td>\n",
       "      <td>4.6637</td>\n",
       "      <td>4.7118</td>\n",
       "      <td>4.6990</td>\n",
       "      <td>4.7249</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2018-01-08</td>\n",
       "      <td>2.4610</td>\n",
       "      <td>2.7370</td>\n",
       "      <td>3.7200</td>\n",
       "      <td>4.2886</td>\n",
       "      <td>4.6594</td>\n",
       "      <td>4.7052</td>\n",
       "      <td>4.6989</td>\n",
       "      <td>4.7200</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>2018-01-09</td>\n",
       "      <td>2.5290</td>\n",
       "      <td>2.7440</td>\n",
       "      <td>3.6980</td>\n",
       "      <td>4.2209</td>\n",
       "      <td>4.6570</td>\n",
       "      <td>4.7026</td>\n",
       "      <td>4.6970</td>\n",
       "      <td>4.7200</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>2018-01-10</td>\n",
       "      <td>2.6430</td>\n",
       "      <td>2.7760</td>\n",
       "      <td>3.7060</td>\n",
       "      <td>4.1821</td>\n",
       "      <td>4.6607</td>\n",
       "      <td>4.6990</td>\n",
       "      <td>4.6970</td>\n",
       "      <td>4.7200</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>2018-01-11</td>\n",
       "      <td>2.8320</td>\n",
       "      <td>2.8320</td>\n",
       "      <td>3.7760</td>\n",
       "      <td>4.1632</td>\n",
       "      <td>4.6701</td>\n",
       "      <td>4.7049</td>\n",
       "      <td>4.7017</td>\n",
       "      <td>4.7230</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>2018-01-12</td>\n",
       "      <td>2.8300</td>\n",
       "      <td>2.8640</td>\n",
       "      <td>3.8080</td>\n",
       "      <td>4.1134</td>\n",
       "      <td>4.6791</td>\n",
       "      <td>4.7085</td>\n",
       "      <td>4.7052</td>\n",
       "      <td>4.7233</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>2018-01-15</td>\n",
       "      <td>2.7940</td>\n",
       "      <td>2.8600</td>\n",
       "      <td>3.8160</td>\n",
       "      <td>4.0904</td>\n",
       "      <td>4.6830</td>\n",
       "      <td>4.7139</td>\n",
       "      <td>4.7116</td>\n",
       "      <td>4.7253</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>2018-01-16</td>\n",
       "      <td>2.7850</td>\n",
       "      <td>2.8790</td>\n",
       "      <td>3.8280</td>\n",
       "      <td>4.0941</td>\n",
       "      <td>4.6843</td>\n",
       "      <td>4.7124</td>\n",
       "      <td>4.7142</td>\n",
       "      <td>4.7296</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>2018-01-17</td>\n",
       "      <td>2.7650</td>\n",
       "      <td>2.8780</td>\n",
       "      <td>3.8370</td>\n",
       "      <td>4.0905</td>\n",
       "      <td>4.6935</td>\n",
       "      <td>4.7133</td>\n",
       "      <td>4.7165</td>\n",
       "      <td>4.7320</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>2018-01-18</td>\n",
       "      <td>2.7655</td>\n",
       "      <td>2.8780</td>\n",
       "      <td>3.8430</td>\n",
       "      <td>4.0921</td>\n",
       "      <td>4.7044</td>\n",
       "      <td>4.7154</td>\n",
       "      <td>4.7237</td>\n",
       "      <td>4.7332</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>2018-01-19</td>\n",
       "      <td>2.8360</td>\n",
       "      <td>2.8910</td>\n",
       "      <td>3.8460</td>\n",
       "      <td>4.1113</td>\n",
       "      <td>4.7115</td>\n",
       "      <td>4.7216</td>\n",
       "      <td>4.7274</td>\n",
       "      <td>4.7384</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>2018-01-22</td>\n",
       "      <td>2.7710</td>\n",
       "      <td>2.8890</td>\n",
       "      <td>3.8540</td>\n",
       "      <td>4.1122</td>\n",
       "      <td>4.7122</td>\n",
       "      <td>4.7272</td>\n",
       "      <td>4.7318</td>\n",
       "      <td>4.7429</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>2018-01-23</td>\n",
       "      <td>2.6020</td>\n",
       "      <td>2.8630</td>\n",
       "      <td>3.8600</td>\n",
       "      <td>4.1123</td>\n",
       "      <td>4.7163</td>\n",
       "      <td>4.7278</td>\n",
       "      <td>4.7322</td>\n",
       "      <td>4.7423</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>2018-01-24</td>\n",
       "      <td>2.5740</td>\n",
       "      <td>2.8320</td>\n",
       "      <td>3.8630</td>\n",
       "      <td>4.1183</td>\n",
       "      <td>4.7267</td>\n",
       "      <td>4.7268</td>\n",
       "      <td>4.7323</td>\n",
       "      <td>4.7423</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>2018-01-25</td>\n",
       "      <td>2.5634</td>\n",
       "      <td>2.8498</td>\n",
       "      <td>3.8600</td>\n",
       "      <td>4.1269</td>\n",
       "      <td>4.7317</td>\n",
       "      <td>4.7297</td>\n",
       "      <td>4.7333</td>\n",
       "      <td>4.7423</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>2018-01-26</td>\n",
       "      <td>2.5506</td>\n",
       "      <td>2.8420</td>\n",
       "      <td>3.8600</td>\n",
       "      <td>4.1257</td>\n",
       "      <td>4.7292</td>\n",
       "      <td>4.7270</td>\n",
       "      <td>4.7324</td>\n",
       "      <td>4.7423</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>2018-01-29</td>\n",
       "      <td>2.5660</td>\n",
       "      <td>2.8420</td>\n",
       "      <td>3.8630</td>\n",
       "      <td>4.1276</td>\n",
       "      <td>4.7270</td>\n",
       "      <td>4.7287</td>\n",
       "      <td>4.7303</td>\n",
       "      <td>4.7423</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>2018-01-30</td>\n",
       "      <td>2.5540</td>\n",
       "      <td>2.8380</td>\n",
       "      <td>3.8580</td>\n",
       "      <td>4.1288</td>\n",
       "      <td>4.7267</td>\n",
       "      <td>4.7299</td>\n",
       "      <td>4.7311</td>\n",
       "      <td>4.7423</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>2018-01-31</td>\n",
       "      <td>2.5940</td>\n",
       "      <td>2.8298</td>\n",
       "      <td>3.8552</td>\n",
       "      <td>4.1289</td>\n",
       "      <td>4.7257</td>\n",
       "      <td>4.7300</td>\n",
       "      <td>4.7312</td>\n",
       "      <td>4.7423</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>2018-02-01</td>\n",
       "      <td>2.5154</td>\n",
       "      <td>2.7925</td>\n",
       "      <td>3.8642</td>\n",
       "      <td>4.1329</td>\n",
       "      <td>4.7276</td>\n",
       "      <td>4.7320</td>\n",
       "      <td>4.7332</td>\n",
       "      <td>4.7463</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>2018-02-02</td>\n",
       "      <td>2.5173</td>\n",
       "      <td>2.7880</td>\n",
       "      <td>3.8670</td>\n",
       "      <td>4.1293</td>\n",
       "      <td>4.7278</td>\n",
       "      <td>4.7322</td>\n",
       "      <td>4.7314</td>\n",
       "      <td>4.7457</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>2018-02-05</td>\n",
       "      <td>2.5305</td>\n",
       "      <td>2.7758</td>\n",
       "      <td>3.8720</td>\n",
       "      <td>4.1070</td>\n",
       "      <td>4.7258</td>\n",
       "      <td>4.7323</td>\n",
       "      <td>4.7302</td>\n",
       "      <td>4.7446</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>2018-02-06</td>\n",
       "      <td>2.5390</td>\n",
       "      <td>2.7706</td>\n",
       "      <td>3.8750</td>\n",
       "      <td>4.0887</td>\n",
       "      <td>4.7206</td>\n",
       "      <td>4.7313</td>\n",
       "      <td>4.7321</td>\n",
       "      <td>4.7465</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>2018-02-07</td>\n",
       "      <td>2.5710</td>\n",
       "      <td>2.7710</td>\n",
       "      <td>3.8830</td>\n",
       "      <td>4.0809</td>\n",
       "      <td>4.7070</td>\n",
       "      <td>4.7302</td>\n",
       "      <td>4.7323</td>\n",
       "      <td>4.7450</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>2018-02-08</td>\n",
       "      <td>2.5720</td>\n",
       "      <td>2.9040</td>\n",
       "      <td>3.8850</td>\n",
       "      <td>4.0780</td>\n",
       "      <td>4.6960</td>\n",
       "      <td>4.7291</td>\n",
       "      <td>4.7313</td>\n",
       "      <td>4.7455</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>2018-02-09</td>\n",
       "      <td>2.5890</td>\n",
       "      <td>2.9180</td>\n",
       "      <td>3.8920</td>\n",
       "      <td>4.0740</td>\n",
       "      <td>4.6936</td>\n",
       "      <td>4.7290</td>\n",
       "      <td>4.7312</td>\n",
       "      <td>4.7456</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>2018-02-11</td>\n",
       "      <td>2.6080</td>\n",
       "      <td>2.9170</td>\n",
       "      <td>3.9080</td>\n",
       "      <td>4.0694</td>\n",
       "      <td>4.6974</td>\n",
       "      <td>4.7289</td>\n",
       "      <td>4.7312</td>\n",
       "      <td>4.7456</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>2018-02-12</td>\n",
       "      <td>2.5850</td>\n",
       "      <td>2.9180</td>\n",
       "      <td>3.9190</td>\n",
       "      <td>4.0750</td>\n",
       "      <td>4.6960</td>\n",
       "      <td>4.7269</td>\n",
       "      <td>4.7312</td>\n",
       "      <td>4.7456</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>2018-02-13</td>\n",
       "      <td>2.5870</td>\n",
       "      <td>2.9280</td>\n",
       "      <td>3.9480</td>\n",
       "      <td>4.0705</td>\n",
       "      <td>4.7006</td>\n",
       "      <td>4.7287</td>\n",
       "      <td>4.7312</td>\n",
       "      <td>4.7456</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>2018-02-14</td>\n",
       "      <td>2.7230</td>\n",
       "      <td>2.9100</td>\n",
       "      <td>3.8760</td>\n",
       "      <td>4.0751</td>\n",
       "      <td>4.7031</td>\n",
       "      <td>4.7280</td>\n",
       "      <td>4.7310</td>\n",
       "      <td>4.7440</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>33</th>\n",
       "      <td>2018-02-22</td>\n",
       "      <td>2.6310</td>\n",
       "      <td>2.8910</td>\n",
       "      <td>3.8550</td>\n",
       "      <td>4.0666</td>\n",
       "      <td>4.7054</td>\n",
       "      <td>4.7268</td>\n",
       "      <td>4.7281</td>\n",
       "      <td>4.7434</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>34</th>\n",
       "      <td>2018-02-23</td>\n",
       "      <td>2.5970</td>\n",
       "      <td>2.8810</td>\n",
       "      <td>3.8630</td>\n",
       "      <td>4.0557</td>\n",
       "      <td>4.7076</td>\n",
       "      <td>4.7307</td>\n",
       "      <td>4.7299</td>\n",
       "      <td>4.7420</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35</th>\n",
       "      <td>2018-02-24</td>\n",
       "      <td>2.5600</td>\n",
       "      <td>2.8760</td>\n",
       "      <td>3.8580</td>\n",
       "      <td>4.0526</td>\n",
       "      <td>4.7078</td>\n",
       "      <td>4.7291</td>\n",
       "      <td>4.7300</td>\n",
       "      <td>4.7420</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>36</th>\n",
       "      <td>2018-02-26</td>\n",
       "      <td>2.5710</td>\n",
       "      <td>2.8700</td>\n",
       "      <td>3.8459</td>\n",
       "      <td>4.0443</td>\n",
       "      <td>4.7128</td>\n",
       "      <td>4.7290</td>\n",
       "      <td>4.7300</td>\n",
       "      <td>4.7420</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>37</th>\n",
       "      <td>2018-02-27</td>\n",
       "      <td>2.5610</td>\n",
       "      <td>2.8610</td>\n",
       "      <td>3.8329</td>\n",
       "      <td>4.0380</td>\n",
       "      <td>4.7103</td>\n",
       "      <td>4.7270</td>\n",
       "      <td>4.7300</td>\n",
       "      <td>4.7422</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>38</th>\n",
       "      <td>2018-02-28</td>\n",
       "      <td>2.7080</td>\n",
       "      <td>2.9060</td>\n",
       "      <td>3.8420</td>\n",
       "      <td>4.0428</td>\n",
       "      <td>4.7131</td>\n",
       "      <td>4.7287</td>\n",
       "      <td>4.7300</td>\n",
       "      <td>4.7420</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>39</th>\n",
       "      <td>2018-03-01</td>\n",
       "      <td>2.6910</td>\n",
       "      <td>2.8960</td>\n",
       "      <td>3.8390</td>\n",
       "      <td>4.0403</td>\n",
       "      <td>4.7154</td>\n",
       "      <td>4.7289</td>\n",
       "      <td>4.7300</td>\n",
       "      <td>4.7420</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         date      ON      1W      2W      1M      3M      6M      9M      1Y\n",
       "0  2018-01-02  2.6570  2.8390  3.9430  4.7430  4.8040  4.8310  4.7150  4.7470\n",
       "1  2018-01-03  2.5635  2.7850  3.8700  4.6220  4.7300  4.7830  4.7110  4.7360\n",
       "2  2018-01-04  2.5050  2.7600  3.8020  4.4760  4.6870  4.7380  4.7020  4.7286\n",
       "3  2018-01-05  2.4840  2.7450  3.7490  4.3756  4.6637  4.7118  4.6990  4.7249\n",
       "4  2018-01-08  2.4610  2.7370  3.7200  4.2886  4.6594  4.7052  4.6989  4.7200\n",
       "5  2018-01-09  2.5290  2.7440  3.6980  4.2209  4.6570  4.7026  4.6970  4.7200\n",
       "6  2018-01-10  2.6430  2.7760  3.7060  4.1821  4.6607  4.6990  4.6970  4.7200\n",
       "7  2018-01-11  2.8320  2.8320  3.7760  4.1632  4.6701  4.7049  4.7017  4.7230\n",
       "8  2018-01-12  2.8300  2.8640  3.8080  4.1134  4.6791  4.7085  4.7052  4.7233\n",
       "9  2018-01-15  2.7940  2.8600  3.8160  4.0904  4.6830  4.7139  4.7116  4.7253\n",
       "10 2018-01-16  2.7850  2.8790  3.8280  4.0941  4.6843  4.7124  4.7142  4.7296\n",
       "11 2018-01-17  2.7650  2.8780  3.8370  4.0905  4.6935  4.7133  4.7165  4.7320\n",
       "12 2018-01-18  2.7655  2.8780  3.8430  4.0921  4.7044  4.7154  4.7237  4.7332\n",
       "13 2018-01-19  2.8360  2.8910  3.8460  4.1113  4.7115  4.7216  4.7274  4.7384\n",
       "14 2018-01-22  2.7710  2.8890  3.8540  4.1122  4.7122  4.7272  4.7318  4.7429\n",
       "15 2018-01-23  2.6020  2.8630  3.8600  4.1123  4.7163  4.7278  4.7322  4.7423\n",
       "16 2018-01-24  2.5740  2.8320  3.8630  4.1183  4.7267  4.7268  4.7323  4.7423\n",
       "17 2018-01-25  2.5634  2.8498  3.8600  4.1269  4.7317  4.7297  4.7333  4.7423\n",
       "18 2018-01-26  2.5506  2.8420  3.8600  4.1257  4.7292  4.7270  4.7324  4.7423\n",
       "19 2018-01-29  2.5660  2.8420  3.8630  4.1276  4.7270  4.7287  4.7303  4.7423\n",
       "20 2018-01-30  2.5540  2.8380  3.8580  4.1288  4.7267  4.7299  4.7311  4.7423\n",
       "21 2018-01-31  2.5940  2.8298  3.8552  4.1289  4.7257  4.7300  4.7312  4.7423\n",
       "22 2018-02-01  2.5154  2.7925  3.8642  4.1329  4.7276  4.7320  4.7332  4.7463\n",
       "23 2018-02-02  2.5173  2.7880  3.8670  4.1293  4.7278  4.7322  4.7314  4.7457\n",
       "24 2018-02-05  2.5305  2.7758  3.8720  4.1070  4.7258  4.7323  4.7302  4.7446\n",
       "25 2018-02-06  2.5390  2.7706  3.8750  4.0887  4.7206  4.7313  4.7321  4.7465\n",
       "26 2018-02-07  2.5710  2.7710  3.8830  4.0809  4.7070  4.7302  4.7323  4.7450\n",
       "27 2018-02-08  2.5720  2.9040  3.8850  4.0780  4.6960  4.7291  4.7313  4.7455\n",
       "28 2018-02-09  2.5890  2.9180  3.8920  4.0740  4.6936  4.7290  4.7312  4.7456\n",
       "29 2018-02-11  2.6080  2.9170  3.9080  4.0694  4.6974  4.7289  4.7312  4.7456\n",
       "30 2018-02-12  2.5850  2.9180  3.9190  4.0750  4.6960  4.7269  4.7312  4.7456\n",
       "31 2018-02-13  2.5870  2.9280  3.9480  4.0705  4.7006  4.7287  4.7312  4.7456\n",
       "32 2018-02-14  2.7230  2.9100  3.8760  4.0751  4.7031  4.7280  4.7310  4.7440\n",
       "33 2018-02-22  2.6310  2.8910  3.8550  4.0666  4.7054  4.7268  4.7281  4.7434\n",
       "34 2018-02-23  2.5970  2.8810  3.8630  4.0557  4.7076  4.7307  4.7299  4.7420\n",
       "35 2018-02-24  2.5600  2.8760  3.8580  4.0526  4.7078  4.7291  4.7300  4.7420\n",
       "36 2018-02-26  2.5710  2.8700  3.8459  4.0443  4.7128  4.7290  4.7300  4.7420\n",
       "37 2018-02-27  2.5610  2.8610  3.8329  4.0380  4.7103  4.7270  4.7300  4.7422\n",
       "38 2018-02-28  2.7080  2.9060  3.8420  4.0428  4.7131  4.7287  4.7300  4.7420\n",
       "39 2018-03-01  2.6910  2.8960  3.8390  4.0403  4.7154  4.7289  4.7300  4.7420"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[Getting data:]#"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>opDate</th>\n",
       "      <th>rzye</th>\n",
       "      <th>rzmre</th>\n",
       "      <th>rqyl</th>\n",
       "      <th>rqylje</th>\n",
       "      <th>rqmcl</th>\n",
       "      <th>rzrqjyzl</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2018-02-28</td>\n",
       "      <td>594617162664</td>\n",
       "      <td>21297493208</td>\n",
       "      <td>519612772</td>\n",
       "      <td>4152781574</td>\n",
       "      <td>90028782</td>\n",
       "      <td>598769944238</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2018-02-27</td>\n",
       "      <td>593011785899</td>\n",
       "      <td>22856603849</td>\n",
       "      <td>515507218</td>\n",
       "      <td>4210700362</td>\n",
       "      <td>74280906</td>\n",
       "      <td>597222486261</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2018-02-26</td>\n",
       "      <td>592714977109</td>\n",
       "      <td>25753904633</td>\n",
       "      <td>539766801</td>\n",
       "      <td>4324525319</td>\n",
       "      <td>97710691</td>\n",
       "      <td>597039502428</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2018-02-23</td>\n",
       "      <td>590318411364</td>\n",
       "      <td>17836336744</td>\n",
       "      <td>538441060</td>\n",
       "      <td>4279690057</td>\n",
       "      <td>80715203</td>\n",
       "      <td>594598101421</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2018-02-22</td>\n",
       "      <td>590374192560</td>\n",
       "      <td>19397930848</td>\n",
       "      <td>537231638</td>\n",
       "      <td>4218365813</td>\n",
       "      <td>141429804</td>\n",
       "      <td>594592558373</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>2018-02-14</td>\n",
       "      <td>587596708400</td>\n",
       "      <td>9746397185</td>\n",
       "      <td>428137439</td>\n",
       "      <td>3390879358</td>\n",
       "      <td>38697420</td>\n",
       "      <td>590987587758</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>2018-02-13</td>\n",
       "      <td>595328087592</td>\n",
       "      <td>16338479817</td>\n",
       "      <td>481300156</td>\n",
       "      <td>3824705594</td>\n",
       "      <td>72708581</td>\n",
       "      <td>599152793186</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>2018-02-12</td>\n",
       "      <td>600926938548</td>\n",
       "      <td>16839248965</td>\n",
       "      <td>481391892</td>\n",
       "      <td>3754839053</td>\n",
       "      <td>100772812</td>\n",
       "      <td>604681777601</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>2018-02-09</td>\n",
       "      <td>604833557210</td>\n",
       "      <td>27580819000</td>\n",
       "      <td>466193240</td>\n",
       "      <td>3573356841</td>\n",
       "      <td>104990562</td>\n",
       "      <td>608406914051</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>2018-02-08</td>\n",
       "      <td>615710148081</td>\n",
       "      <td>25870067541</td>\n",
       "      <td>466231986</td>\n",
       "      <td>3785537067</td>\n",
       "      <td>80582428</td>\n",
       "      <td>619495685148</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>2018-02-07</td>\n",
       "      <td>616405478519</td>\n",
       "      <td>35263849592</td>\n",
       "      <td>489860104</td>\n",
       "      <td>4007914605</td>\n",
       "      <td>95806694</td>\n",
       "      <td>620413393124</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>2018-02-06</td>\n",
       "      <td>619290275865</td>\n",
       "      <td>31544870755</td>\n",
       "      <td>510319945</td>\n",
       "      <td>4188948545</td>\n",
       "      <td>96446231</td>\n",
       "      <td>623479224410</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>2018-02-05</td>\n",
       "      <td>630054975768</td>\n",
       "      <td>29843195422</td>\n",
       "      <td>514623809</td>\n",
       "      <td>4322740448</td>\n",
       "      <td>104110875</td>\n",
       "      <td>634377716216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>2018-02-02</td>\n",
       "      <td>631035437334</td>\n",
       "      <td>27287974198</td>\n",
       "      <td>473192696</td>\n",
       "      <td>4042598212</td>\n",
       "      <td>56031475</td>\n",
       "      <td>635078035546</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>2018-02-01</td>\n",
       "      <td>636482319607</td>\n",
       "      <td>29702648663</td>\n",
       "      <td>502463110</td>\n",
       "      <td>4233708630</td>\n",
       "      <td>79415607</td>\n",
       "      <td>640716028237</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>2018-01-31</td>\n",
       "      <td>645400680690</td>\n",
       "      <td>28966225507</td>\n",
       "      <td>483571589</td>\n",
       "      <td>4054638580</td>\n",
       "      <td>73671246</td>\n",
       "      <td>649455319270</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>2018-01-30</td>\n",
       "      <td>648176166579</td>\n",
       "      <td>28745206171</td>\n",
       "      <td>478033248</td>\n",
       "      <td>4058242338</td>\n",
       "      <td>60408630</td>\n",
       "      <td>652234408917</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>2018-01-29</td>\n",
       "      <td>648256047965</td>\n",
       "      <td>38181209245</td>\n",
       "      <td>501055416</td>\n",
       "      <td>4192740627</td>\n",
       "      <td>71491288</td>\n",
       "      <td>652448788592</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>2018-01-26</td>\n",
       "      <td>646634615949</td>\n",
       "      <td>34247168309</td>\n",
       "      <td>516847971</td>\n",
       "      <td>4269286836</td>\n",
       "      <td>76289213</td>\n",
       "      <td>650903902785</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>2018-01-25</td>\n",
       "      <td>647529134317</td>\n",
       "      <td>38141340740</td>\n",
       "      <td>533190722</td>\n",
       "      <td>4381538742</td>\n",
       "      <td>95255666</td>\n",
       "      <td>651910673059</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>2018-01-24</td>\n",
       "      <td>646859187212</td>\n",
       "      <td>42616129855</td>\n",
       "      <td>542170310</td>\n",
       "      <td>4448193750</td>\n",
       "      <td>98229541</td>\n",
       "      <td>651307380962</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>2018-01-23</td>\n",
       "      <td>644564213418</td>\n",
       "      <td>37876068321</td>\n",
       "      <td>540815711</td>\n",
       "      <td>4455055561</td>\n",
       "      <td>86183139</td>\n",
       "      <td>649019268979</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>2018-01-22</td>\n",
       "      <td>639921300534</td>\n",
       "      <td>33237544268</td>\n",
       "      <td>542599432</td>\n",
       "      <td>4354081581</td>\n",
       "      <td>87925167</td>\n",
       "      <td>644275382115</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>2018-01-19</td>\n",
       "      <td>636018905560</td>\n",
       "      <td>37339370592</td>\n",
       "      <td>554563499</td>\n",
       "      <td>4378780910</td>\n",
       "      <td>105099649</td>\n",
       "      <td>640397686470</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>2018-01-18</td>\n",
       "      <td>634228438561</td>\n",
       "      <td>36979327828</td>\n",
       "      <td>552058099</td>\n",
       "      <td>4477045539</td>\n",
       "      <td>103608937</td>\n",
       "      <td>638705484100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>2018-01-17</td>\n",
       "      <td>627094987907</td>\n",
       "      <td>39842179516</td>\n",
       "      <td>567252405</td>\n",
       "      <td>4454773086</td>\n",
       "      <td>138072735</td>\n",
       "      <td>631549760993</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>2018-01-16</td>\n",
       "      <td>625992542194</td>\n",
       "      <td>34078228867</td>\n",
       "      <td>503553012</td>\n",
       "      <td>4133975739</td>\n",
       "      <td>74508764</td>\n",
       "      <td>630126517933</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>2018-01-15</td>\n",
       "      <td>621497637591</td>\n",
       "      <td>36278584789</td>\n",
       "      <td>569752152</td>\n",
       "      <td>4379791823</td>\n",
       "      <td>132724788</td>\n",
       "      <td>625877429414</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>2018-01-12</td>\n",
       "      <td>619848249343</td>\n",
       "      <td>26368470723</td>\n",
       "      <td>506595130</td>\n",
       "      <td>4093318611</td>\n",
       "      <td>80954815</td>\n",
       "      <td>623941567954</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>2018-01-11</td>\n",
       "      <td>621046744130</td>\n",
       "      <td>28156920753</td>\n",
       "      <td>518981283</td>\n",
       "      <td>4177520514</td>\n",
       "      <td>85734540</td>\n",
       "      <td>625224264644</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>2018-01-10</td>\n",
       "      <td>619625092233</td>\n",
       "      <td>33230513439</td>\n",
       "      <td>515254713</td>\n",
       "      <td>4205771294</td>\n",
       "      <td>88968220</td>\n",
       "      <td>623830863527</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>2018-01-09</td>\n",
       "      <td>616540107796</td>\n",
       "      <td>30086145554</td>\n",
       "      <td>492605694</td>\n",
       "      <td>4077347539</td>\n",
       "      <td>69350546</td>\n",
       "      <td>620617455335</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>2018-01-08</td>\n",
       "      <td>614437310945</td>\n",
       "      <td>36490715414</td>\n",
       "      <td>520467167</td>\n",
       "      <td>4207633747</td>\n",
       "      <td>104853368</td>\n",
       "      <td>618644944692</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>33</th>\n",
       "      <td>2018-01-05</td>\n",
       "      <td>611033498008</td>\n",
       "      <td>30311498312</td>\n",
       "      <td>475185679</td>\n",
       "      <td>3909520577</td>\n",
       "      <td>72649378</td>\n",
       "      <td>614943018585</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>34</th>\n",
       "      <td>2018-01-04</td>\n",
       "      <td>610527948195</td>\n",
       "      <td>29696616884</td>\n",
       "      <td>473343923</td>\n",
       "      <td>3955106395</td>\n",
       "      <td>81062102</td>\n",
       "      <td>614483054590</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35</th>\n",
       "      <td>2018-01-03</td>\n",
       "      <td>608815534517</td>\n",
       "      <td>30439570182</td>\n",
       "      <td>448392069</td>\n",
       "      <td>3772954586</td>\n",
       "      <td>74917924</td>\n",
       "      <td>612588489103</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>36</th>\n",
       "      <td>2018-01-02</td>\n",
       "      <td>608366051878</td>\n",
       "      <td>27590480172</td>\n",
       "      <td>441452197</td>\n",
       "      <td>3654085132</td>\n",
       "      <td>76344279</td>\n",
       "      <td>612020137010</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        opDate          rzye        rzmre       rqyl      rqylje      rqmcl  \\\n",
       "0   2018-02-28  594617162664  21297493208  519612772  4152781574   90028782   \n",
       "1   2018-02-27  593011785899  22856603849  515507218  4210700362   74280906   \n",
       "2   2018-02-26  592714977109  25753904633  539766801  4324525319   97710691   \n",
       "3   2018-02-23  590318411364  17836336744  538441060  4279690057   80715203   \n",
       "4   2018-02-22  590374192560  19397930848  537231638  4218365813  141429804   \n",
       "5   2018-02-14  587596708400   9746397185  428137439  3390879358   38697420   \n",
       "6   2018-02-13  595328087592  16338479817  481300156  3824705594   72708581   \n",
       "7   2018-02-12  600926938548  16839248965  481391892  3754839053  100772812   \n",
       "8   2018-02-09  604833557210  27580819000  466193240  3573356841  104990562   \n",
       "9   2018-02-08  615710148081  25870067541  466231986  3785537067   80582428   \n",
       "10  2018-02-07  616405478519  35263849592  489860104  4007914605   95806694   \n",
       "11  2018-02-06  619290275865  31544870755  510319945  4188948545   96446231   \n",
       "12  2018-02-05  630054975768  29843195422  514623809  4322740448  104110875   \n",
       "13  2018-02-02  631035437334  27287974198  473192696  4042598212   56031475   \n",
       "14  2018-02-01  636482319607  29702648663  502463110  4233708630   79415607   \n",
       "15  2018-01-31  645400680690  28966225507  483571589  4054638580   73671246   \n",
       "16  2018-01-30  648176166579  28745206171  478033248  4058242338   60408630   \n",
       "17  2018-01-29  648256047965  38181209245  501055416  4192740627   71491288   \n",
       "18  2018-01-26  646634615949  34247168309  516847971  4269286836   76289213   \n",
       "19  2018-01-25  647529134317  38141340740  533190722  4381538742   95255666   \n",
       "20  2018-01-24  646859187212  42616129855  542170310  4448193750   98229541   \n",
       "21  2018-01-23  644564213418  37876068321  540815711  4455055561   86183139   \n",
       "22  2018-01-22  639921300534  33237544268  542599432  4354081581   87925167   \n",
       "23  2018-01-19  636018905560  37339370592  554563499  4378780910  105099649   \n",
       "24  2018-01-18  634228438561  36979327828  552058099  4477045539  103608937   \n",
       "25  2018-01-17  627094987907  39842179516  567252405  4454773086  138072735   \n",
       "26  2018-01-16  625992542194  34078228867  503553012  4133975739   74508764   \n",
       "27  2018-01-15  621497637591  36278584789  569752152  4379791823  132724788   \n",
       "28  2018-01-12  619848249343  26368470723  506595130  4093318611   80954815   \n",
       "29  2018-01-11  621046744130  28156920753  518981283  4177520514   85734540   \n",
       "30  2018-01-10  619625092233  33230513439  515254713  4205771294   88968220   \n",
       "31  2018-01-09  616540107796  30086145554  492605694  4077347539   69350546   \n",
       "32  2018-01-08  614437310945  36490715414  520467167  4207633747  104853368   \n",
       "33  2018-01-05  611033498008  30311498312  475185679  3909520577   72649378   \n",
       "34  2018-01-04  610527948195  29696616884  473343923  3955106395   81062102   \n",
       "35  2018-01-03  608815534517  30439570182  448392069  3772954586   74917924   \n",
       "36  2018-01-02  608366051878  27590480172  441452197  3654085132   76344279   \n",
       "\n",
       "        rzrqjyzl  \n",
       "0   598769944238  \n",
       "1   597222486261  \n",
       "2   597039502428  \n",
       "3   594598101421  \n",
       "4   594592558373  \n",
       "5   590987587758  \n",
       "6   599152793186  \n",
       "7   604681777601  \n",
       "8   608406914051  \n",
       "9   619495685148  \n",
       "10  620413393124  \n",
       "11  623479224410  \n",
       "12  634377716216  \n",
       "13  635078035546  \n",
       "14  640716028237  \n",
       "15  649455319270  \n",
       "16  652234408917  \n",
       "17  652448788592  \n",
       "18  650903902785  \n",
       "19  651910673059  \n",
       "20  651307380962  \n",
       "21  649019268979  \n",
       "22  644275382115  \n",
       "23  640397686470  \n",
       "24  638705484100  \n",
       "25  631549760993  \n",
       "26  630126517933  \n",
       "27  625877429414  \n",
       "28  623941567954  \n",
       "29  625224264644  \n",
       "30  623830863527  \n",
       "31  620617455335  \n",
       "32  618644944692  \n",
       "33  614943018585  \n",
       "34  614483054590  \n",
       "35  612588489103  \n",
       "36  612020137010  "
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import tushare as ts\n",
    "\n",
    "# opDate:信用交易日期\n",
    "# rzye:本日融资余额(元)\n",
    "# rzmre: 本日融资买入额(元)\n",
    "# rqyl: 本日融券余量\n",
    "# rqylje: 本日融券余量金额(元)\n",
    "# rqmcl: 本日融券卖出量\n",
    "# rzrqjyzl:本日融资融券余额(元)\n",
    "\n",
    "ts.sh_margins(start='2018-01-01', end='2018-03-01')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[Getting data:]############################################"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>rzmre</th>\n",
       "      <th>rzye</th>\n",
       "      <th>rqmcl</th>\n",
       "      <th>rqyl</th>\n",
       "      <th>rqye</th>\n",
       "      <th>rzrqye</th>\n",
       "      <th>opDate</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>19318739801</td>\n",
       "      <td>416786551136</td>\n",
       "      <td>16854859</td>\n",
       "      <td>68835305</td>\n",
       "      <td>1002431176</td>\n",
       "      <td>417788982312</td>\n",
       "      <td>2018-01-02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>24600561646</td>\n",
       "      <td>418038453643</td>\n",
       "      <td>19978687</td>\n",
       "      <td>72416295</td>\n",
       "      <td>1020955675</td>\n",
       "      <td>419059409318</td>\n",
       "      <td>2018-01-03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>21219153695</td>\n",
       "      <td>418393156625</td>\n",
       "      <td>18747022</td>\n",
       "      <td>72591994</td>\n",
       "      <td>1051553585</td>\n",
       "      <td>419444710210</td>\n",
       "      <td>2018-01-04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>21590954402</td>\n",
       "      <td>417780059574</td>\n",
       "      <td>20702321</td>\n",
       "      <td>75096316</td>\n",
       "      <td>1052191948</td>\n",
       "      <td>418832251522</td>\n",
       "      <td>2018-01-05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>25295660627</td>\n",
       "      <td>419757512895</td>\n",
       "      <td>17673647</td>\n",
       "      <td>73228177</td>\n",
       "      <td>1035018020</td>\n",
       "      <td>420792530915</td>\n",
       "      <td>2018-01-08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>22612670713</td>\n",
       "      <td>421331167175</td>\n",
       "      <td>16498273</td>\n",
       "      <td>73829820</td>\n",
       "      <td>1047728025</td>\n",
       "      <td>422378895200</td>\n",
       "      <td>2018-01-09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>23888251468</td>\n",
       "      <td>422887438096</td>\n",
       "      <td>13658463</td>\n",
       "      <td>71043183</td>\n",
       "      <td>1028609238</td>\n",
       "      <td>423916047334</td>\n",
       "      <td>2018-01-10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>22739642154</td>\n",
       "      <td>424530615308</td>\n",
       "      <td>16558697</td>\n",
       "      <td>73787108</td>\n",
       "      <td>1076428651</td>\n",
       "      <td>425607043959</td>\n",
       "      <td>2018-01-11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>20701954249</td>\n",
       "      <td>423711946855</td>\n",
       "      <td>13700620</td>\n",
       "      <td>70339680</td>\n",
       "      <td>1028439649</td>\n",
       "      <td>424740386504</td>\n",
       "      <td>2018-01-12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>27200167361</td>\n",
       "      <td>423688666962</td>\n",
       "      <td>22040012</td>\n",
       "      <td>76190075</td>\n",
       "      <td>1085817849</td>\n",
       "      <td>424774484811</td>\n",
       "      <td>2018-01-15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>24630900120</td>\n",
       "      <td>424795783333</td>\n",
       "      <td>20847473</td>\n",
       "      <td>76754736</td>\n",
       "      <td>1101566772</td>\n",
       "      <td>425897350105</td>\n",
       "      <td>2018-01-16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>28308747083</td>\n",
       "      <td>425352253011</td>\n",
       "      <td>32351726</td>\n",
       "      <td>86120482</td>\n",
       "      <td>1139420634</td>\n",
       "      <td>426491673645</td>\n",
       "      <td>2018-01-17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>18645872553</td>\n",
       "      <td>425649876189</td>\n",
       "      <td>22844734</td>\n",
       "      <td>80107823</td>\n",
       "      <td>1068073043</td>\n",
       "      <td>426717949232</td>\n",
       "      <td>2018-01-18</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>22197715872</td>\n",
       "      <td>425038667651</td>\n",
       "      <td>23082290</td>\n",
       "      <td>78451316</td>\n",
       "      <td>1072714036</td>\n",
       "      <td>426111381687</td>\n",
       "      <td>2018-01-19</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>22844579254</td>\n",
       "      <td>426337351348</td>\n",
       "      <td>17963671</td>\n",
       "      <td>74615557</td>\n",
       "      <td>1087589406</td>\n",
       "      <td>427424940754</td>\n",
       "      <td>2018-01-22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>21606579298</td>\n",
       "      <td>426841578991</td>\n",
       "      <td>20286706</td>\n",
       "      <td>76540447</td>\n",
       "      <td>1073592172</td>\n",
       "      <td>427915171163</td>\n",
       "      <td>2018-01-23</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>28228438389</td>\n",
       "      <td>428978787026</td>\n",
       "      <td>20954320</td>\n",
       "      <td>74365678</td>\n",
       "      <td>1070477341</td>\n",
       "      <td>430049264367</td>\n",
       "      <td>2018-01-24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>26786075436</td>\n",
       "      <td>428834763488</td>\n",
       "      <td>18833252</td>\n",
       "      <td>73167268</td>\n",
       "      <td>1039365039</td>\n",
       "      <td>429874128527</td>\n",
       "      <td>2018-01-25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>21717443254</td>\n",
       "      <td>427640006021</td>\n",
       "      <td>13804903</td>\n",
       "      <td>68144348</td>\n",
       "      <td>998026906</td>\n",
       "      <td>428638032927</td>\n",
       "      <td>2018-01-26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>25780409108</td>\n",
       "      <td>429733941151</td>\n",
       "      <td>16558214</td>\n",
       "      <td>70035385</td>\n",
       "      <td>1007744281</td>\n",
       "      <td>430741685432</td>\n",
       "      <td>2018-01-29</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>19762375752</td>\n",
       "      <td>430224103947</td>\n",
       "      <td>13672607</td>\n",
       "      <td>67105162</td>\n",
       "      <td>949537114</td>\n",
       "      <td>431173641061</td>\n",
       "      <td>2018-01-30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>21565619487</td>\n",
       "      <td>428872876720</td>\n",
       "      <td>17608080</td>\n",
       "      <td>67918651</td>\n",
       "      <td>966806901</td>\n",
       "      <td>429839683621</td>\n",
       "      <td>2018-01-31</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>22877129433</td>\n",
       "      <td>425272063589</td>\n",
       "      <td>30588723</td>\n",
       "      <td>79876842</td>\n",
       "      <td>971417353</td>\n",
       "      <td>426243480942</td>\n",
       "      <td>2018-02-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>18519765446</td>\n",
       "      <td>421722516810</td>\n",
       "      <td>19797479</td>\n",
       "      <td>69303969</td>\n",
       "      <td>944637596</td>\n",
       "      <td>422667154406</td>\n",
       "      <td>2018-02-02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>18187429157</td>\n",
       "      <td>420712495129</td>\n",
       "      <td>16812387</td>\n",
       "      <td>66726359</td>\n",
       "      <td>891062919</td>\n",
       "      <td>421603558048</td>\n",
       "      <td>2018-02-05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>21138241827</td>\n",
       "      <td>415230395334</td>\n",
       "      <td>22102640</td>\n",
       "      <td>69875518</td>\n",
       "      <td>897220549</td>\n",
       "      <td>416127615883</td>\n",
       "      <td>2018-02-06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>21879143708</td>\n",
       "      <td>412743088709</td>\n",
       "      <td>18952490</td>\n",
       "      <td>65164662</td>\n",
       "      <td>851868545</td>\n",
       "      <td>413594957254</td>\n",
       "      <td>2018-02-07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>14983684511</td>\n",
       "      <td>410223893273</td>\n",
       "      <td>16546608</td>\n",
       "      <td>64264807</td>\n",
       "      <td>828197873</td>\n",
       "      <td>411052091146</td>\n",
       "      <td>2018-02-08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>16632503194</td>\n",
       "      <td>403099304754</td>\n",
       "      <td>21884782</td>\n",
       "      <td>62542206</td>\n",
       "      <td>762602182</td>\n",
       "      <td>403861906936</td>\n",
       "      <td>2018-02-09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>12901740468</td>\n",
       "      <td>399516672512</td>\n",
       "      <td>14280626</td>\n",
       "      <td>59564848</td>\n",
       "      <td>795381254</td>\n",
       "      <td>400312053766</td>\n",
       "      <td>2018-02-12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>12828233808</td>\n",
       "      <td>396006009472</td>\n",
       "      <td>14833701</td>\n",
       "      <td>62730670</td>\n",
       "      <td>811874115</td>\n",
       "      <td>396817883587</td>\n",
       "      <td>2018-02-13</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>8148260700</td>\n",
       "      <td>390176660654</td>\n",
       "      <td>5840577</td>\n",
       "      <td>50553139</td>\n",
       "      <td>675723881</td>\n",
       "      <td>390852384535</td>\n",
       "      <td>2018-02-14</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>15932617570</td>\n",
       "      <td>392133610438</td>\n",
       "      <td>22459380</td>\n",
       "      <td>66098425</td>\n",
       "      <td>883536225</td>\n",
       "      <td>393017146663</td>\n",
       "      <td>2018-02-22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>14417203372</td>\n",
       "      <td>392347602366</td>\n",
       "      <td>13922773</td>\n",
       "      <td>64917069</td>\n",
       "      <td>854612103</td>\n",
       "      <td>393202214469</td>\n",
       "      <td>2018-02-23</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>23324148143</td>\n",
       "      <td>395007796231</td>\n",
       "      <td>24149747</td>\n",
       "      <td>74023715</td>\n",
       "      <td>976879039</td>\n",
       "      <td>395984675270</td>\n",
       "      <td>2018-02-26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>21177881293</td>\n",
       "      <td>395770641779</td>\n",
       "      <td>14092510</td>\n",
       "      <td>66956719</td>\n",
       "      <td>915414924</td>\n",
       "      <td>396686056703</td>\n",
       "      <td>2018-02-27</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>19499737961</td>\n",
       "      <td>395679399247</td>\n",
       "      <td>20712846</td>\n",
       "      <td>73462447</td>\n",
       "      <td>1017585886</td>\n",
       "      <td>396696985133</td>\n",
       "      <td>2018-02-28</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         rzmre          rzye     rqmcl      rqyl        rqye        rzrqye  \\\n",
       "0  19318739801  416786551136  16854859  68835305  1002431176  417788982312   \n",
       "0  24600561646  418038453643  19978687  72416295  1020955675  419059409318   \n",
       "0  21219153695  418393156625  18747022  72591994  1051553585  419444710210   \n",
       "0  21590954402  417780059574  20702321  75096316  1052191948  418832251522   \n",
       "0  25295660627  419757512895  17673647  73228177  1035018020  420792530915   \n",
       "0  22612670713  421331167175  16498273  73829820  1047728025  422378895200   \n",
       "0  23888251468  422887438096  13658463  71043183  1028609238  423916047334   \n",
       "0  22739642154  424530615308  16558697  73787108  1076428651  425607043959   \n",
       "0  20701954249  423711946855  13700620  70339680  1028439649  424740386504   \n",
       "0  27200167361  423688666962  22040012  76190075  1085817849  424774484811   \n",
       "0  24630900120  424795783333  20847473  76754736  1101566772  425897350105   \n",
       "0  28308747083  425352253011  32351726  86120482  1139420634  426491673645   \n",
       "0  18645872553  425649876189  22844734  80107823  1068073043  426717949232   \n",
       "0  22197715872  425038667651  23082290  78451316  1072714036  426111381687   \n",
       "0  22844579254  426337351348  17963671  74615557  1087589406  427424940754   \n",
       "0  21606579298  426841578991  20286706  76540447  1073592172  427915171163   \n",
       "0  28228438389  428978787026  20954320  74365678  1070477341  430049264367   \n",
       "0  26786075436  428834763488  18833252  73167268  1039365039  429874128527   \n",
       "0  21717443254  427640006021  13804903  68144348   998026906  428638032927   \n",
       "0  25780409108  429733941151  16558214  70035385  1007744281  430741685432   \n",
       "0  19762375752  430224103947  13672607  67105162   949537114  431173641061   \n",
       "0  21565619487  428872876720  17608080  67918651   966806901  429839683621   \n",
       "0  22877129433  425272063589  30588723  79876842   971417353  426243480942   \n",
       "0  18519765446  421722516810  19797479  69303969   944637596  422667154406   \n",
       "0  18187429157  420712495129  16812387  66726359   891062919  421603558048   \n",
       "0  21138241827  415230395334  22102640  69875518   897220549  416127615883   \n",
       "0  21879143708  412743088709  18952490  65164662   851868545  413594957254   \n",
       "0  14983684511  410223893273  16546608  64264807   828197873  411052091146   \n",
       "0  16632503194  403099304754  21884782  62542206   762602182  403861906936   \n",
       "0  12901740468  399516672512  14280626  59564848   795381254  400312053766   \n",
       "0  12828233808  396006009472  14833701  62730670   811874115  396817883587   \n",
       "0   8148260700  390176660654   5840577  50553139   675723881  390852384535   \n",
       "0  15932617570  392133610438  22459380  66098425   883536225  393017146663   \n",
       "0  14417203372  392347602366  13922773  64917069   854612103  393202214469   \n",
       "0  23324148143  395007796231  24149747  74023715   976879039  395984675270   \n",
       "0  21177881293  395770641779  14092510  66956719   915414924  396686056703   \n",
       "0  19499737961  395679399247  20712846  73462447  1017585886  396696985133   \n",
       "\n",
       "       opDate  \n",
       "0  2018-01-02  \n",
       "0  2018-01-03  \n",
       "0  2018-01-04  \n",
       "0  2018-01-05  \n",
       "0  2018-01-08  \n",
       "0  2018-01-09  \n",
       "0  2018-01-10  \n",
       "0  2018-01-11  \n",
       "0  2018-01-12  \n",
       "0  2018-01-15  \n",
       "0  2018-01-16  \n",
       "0  2018-01-17  \n",
       "0  2018-01-18  \n",
       "0  2018-01-19  \n",
       "0  2018-01-22  \n",
       "0  2018-01-23  \n",
       "0  2018-01-24  \n",
       "0  2018-01-25  \n",
       "0  2018-01-26  \n",
       "0  2018-01-29  \n",
       "0  2018-01-30  \n",
       "0  2018-01-31  \n",
       "0  2018-02-01  \n",
       "0  2018-02-02  \n",
       "0  2018-02-05  \n",
       "0  2018-02-06  \n",
       "0  2018-02-07  \n",
       "0  2018-02-08  \n",
       "0  2018-02-09  \n",
       "0  2018-02-12  \n",
       "0  2018-02-13  \n",
       "0  2018-02-14  \n",
       "0  2018-02-22  \n",
       "0  2018-02-23  \n",
       "0  2018-02-26  \n",
       "0  2018-02-27  \n",
       "0  2018-02-28  "
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import tushare as ts\n",
    "\n",
    "ts.sz_margins(start='2018-01-01', end='2018-03-01')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
